<!DOCTYPE html>
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://shiro.apache.org/tags" prefix="shiro" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>会员详细</title>
<jsp:include page="/common/commonCss.jsp" />
<jsp:include page="/common/commonJs.jsp" />
<script src="${basePath }commonJs/tags/My97DatePicker/WdatePicker.js"></script>
<script src="${basePath }resources/membership/finger.js"></script>
<script src="${basePath }resources/membership/single.js"></script>


<style>
#listBoxTop{width: 496px;}        
#containerTop{ float:left;width: 556px;}
#listBox{width: 420px;}
#container{width: 500px;}
</style>
<script src="${basePath}commonJs/jquery.imageScroller.js"></script>
<script type="text/javascript">

	$(function () {
		 $("#listBoxTop").imageScroller({
	         next: "btnNextTop",
	         prev: "btnPrevTop",
	         frame: "listTop",
	         child: "li",
	         auto: false
	     });
	    $("#listBox").imageScroller({
	        next: "btnNext",
	        prev: "btnPrev",
	        frame: "list",
	        child: "li",
	        auto: false
	    });
	});
	
	
	// 选中的会员
	var selMemberId = "";
	var selMemType = "";
	var selStatus = "";
	var selSignDisclaimer = "";
	var selAge = "";
	var selReceivePwd = "";
	var selGuaCnt = "";
	var selGuaTicketCount = "";
	var base = "${basePath}";
	
function setMemberCss(t,status,signDisclaimer,age,inTime,outTime,receivePwd,isBlack,guaCnt,guaTicketCount,memType,isSingleTicket) {
	var memTypeString = "会员";
	if(memType=="2"){
		memTypeString = "非会员";
	}
	if(isBlack==1 || status==3 || status==4 || status==null || status==''){//红色-问题（过期/黑名单/停卡）
		if(isBlack==1){
			alertError("黑名单用户无权限操作，谢谢！");
			return;
		}
		if(status==3){
			alertError(memTypeString+"过期，请续费，谢谢！");
			return;
		}
		if(status==4){
			if((inTime!=null && inTime!="") && (outTime==null || outTime=="")){//绿色-场内
				//不做操作
			}else{//灰色-场外
				if(isSingleTicket==false){
					alertError("会员已停卡，谢谢！");
					return;
				}
			}
		}else{
			alertError(memTypeString+"过期，请续费，谢谢！");
			return;
		}
	}
	
	var type="${type}";//1：入场；2：出场
	if(null!=type && type=="1"){
		if((inTime!=null && inTime!="") && (outTime==null || outTime=="")){//绿色-场内不能入场
			return;
		}
	}else{
		if((inTime==null || inTime=="") || (outTime!=null && outTime!="")){//场外的
			return;
		}
	}
	
	if (t == null) return;
	
		if (selMemberId!="" && selMemberId.indexOf(t.id)!=-1) {
			if(selMemberId.indexOf(t.id)==0){//id在第一位时
				if(selMemberId.indexOf(",")!=-1){//有逗号时
					selMemberId=selMemberId.replace(t.id+",", "");//连逗号一起替换
					selMemType=selMemType.replace(memType+",", "");//连逗号一起替换
					selStatus=selStatus.replace(status+",", "");//连逗号一起替换
					selSignDisclaimer=selSignDisclaimer.replace(signDisclaimer+",", "");//连逗号一起替换
					selAge=selAge.replace(age+",", "");//连逗号一起替换
					selReceivePwd=selReceivePwd.replace(receivePwd+",", "");//连逗号一起替换
					selGuaCnt=selGuaCnt.replace(guaCnt+",", "");//连逗号一起替换
					selGuaTicketCount=selGuaTicketCount.replace(guaTicketCount+",", "");//连逗号一起替换
				}else{
					selMemberId=selMemberId.replace(t.id, "");//替换唯一的一个
					selMemType=selMemType.replace(memType, "");//替换唯一的一个
					selStatus=selStatus.replace(status, "");//替换唯一的一个
					selSignDisclaimer=selSignDisclaimer.replace(signDisclaimer, "");//替换唯一的一个
					selAge=selAge.replace(age, "");//替换唯一的一个
					selReceivePwd=selReceivePwd.replace(receivePwd, "");//替换唯一的一个
					selGuaCnt=selGuaCnt.replace(guaCnt, "");//替换唯一的一个
					selGuaTicketCount=selGuaTicketCount.replace(guaTicketCount, "");//替换唯一的一个
				}
			}
			
			//id在中间时
			if(selMemberId.indexOf(","+t.id)!=-1){//有逗号时
				selMemberId=selMemberId.replace(","+t.id, "");//连逗号一起替换
				selMemType=selMemType.replace(","+memType, "");//连逗号一起替换
				selStatus=selStatus.replace(","+status, "");//连逗号一起替换
				selSignDisclaimer=selSignDisclaimer.replace(","+signDisclaimer, "");//连逗号一起替换
				selAge=selAge.replace(","+age, "");//连逗号一起替换
				selReceivePwd=selReceivePwd.replace(","+receivePwd, "");//连逗号一起替换
				selGuaCnt=selGuaCnt.replace(","+guaCnt, "");//连逗号一起替换
				selGuaTicketCount=selGuaTicketCount.replace(","+guaTicketCount, "");//连逗号一起替换
			}
			
			//t.style.backgroundColor = '';
			//判断小朋友头像背景色
			var bgColor="";
			if(isBlack==1 || status==3 || status==4 || status==null || status==''){//红色-问题（过期/黑名单/停卡）
				if((inTime!=null && inTime!="") && (outTime==null || outTime=="")){//绿色-场内
					bgColor="coll_img colle_img_lv";
				}else{//灰色-场外
					if(status==4 && isSingleTicket==true){
						bgColor="coll_img colle_img_ccc";
					}else{
						bgColor="coll_img colle_img_red";
					}
				}
			}else{
				if((inTime!=null && inTime!="") && (outTime==null || outTime=="")){//绿色-场内
					bgColor="coll_img colle_img_lv";
				}else{//灰色-场外
					bgColor="coll_img colle_img_ccc";
				}
			}
			$("#"+t.id).attr("class",bgColor);
		} else {
			//t.style.backgroundColor = '#6eafdd';
			$("#"+t.id).attr("class","coll_img colle_img_blue");
			
			if(selMemberId==""){
				selReceivePwd += receivePwd;
			}else{
				selReceivePwd += ","+receivePwd;
			}
			
			if(selMemberId==""){
				selMemberId += t.id;
			}else{
				selMemberId += ","+t.id;
			}
			
			if(selMemType==""){
				selMemType += memType;
			}else{
				selMemType += ","+memType;
			}
			
			if(selStatus==""){
				selStatus += status;
			}else{
				selStatus += ","+status;
			}
			
			if(selSignDisclaimer==""){
				selSignDisclaimer += signDisclaimer;
			}else{
				selSignDisclaimer += ","+signDisclaimer;
			}
			
			if(selAge==""){
				selAge += age;
			}else{
				selAge += ","+age;
			}
			
			if(selGuaCnt==""){
				selGuaCnt += guaCnt;
			}else{
				selGuaCnt += ","+guaCnt;
			}
			
			if(selGuaTicketCount==""){
				selGuaTicketCount += guaTicketCount;
			}else{
				selGuaTicketCount += ","+guaTicketCount;
			}
		}
		$("#inMemberIds").val(selMemberId);
		$("#inMemTypes").val(selMemType);
		$("#inStatuss").val(selStatus);
		$("#signDisclaimers").val(selSignDisclaimer);
		$("#ages").val(selAge);
		$("#receivePwds").val(selReceivePwd);
		$("#inGuaCnts").val(selGuaCnt);
		$("#inGuaTicketCounts").val(selGuaTicketCount);
}

/* $(document).ready(function() {
	// 初始化当前会员为选中状态
	setMemberCss(document.getElementById("${memberId}"),"${memberInfo.status}","${memberInfo.signDisclaimer}","${memberInfo.age}","${memberInfo.inTime}","${memberInfo.outTime}");
}); */

//选中的监护人
var selGuaId = "";
//监护人
function setGuaCss(t,inTime,outTime) {
	var type="${type}";//1：入场；2：出场
	if(null!=type && type=="1"){
		if((inTime!=null && inTime!="") && (outTime==null || outTime=="")){//绿色-场内不能入场
			return;
		}
	}else{
		if((inTime==null || inTime=="") || (outTime!=null && outTime!="")){//场外的
			return;
		}
	}
	
	if (t == null) return;
		if (selGuaId!="" && selGuaId.indexOf(t.id)!=-1) {
			if(selGuaId.indexOf(t.id)==0){//id在第一位时
				if(selGuaId.indexOf(",")!=-1){//有逗号时
					selGuaId=selGuaId.replace(t.id+",", "");//连逗号一起替换
				}else{
					selGuaId=selGuaId.replace(t.id, "");//替换唯一的一个
				}
			}
			
			//id在中间时
			if(selGuaId.indexOf(","+t.id)!=-1){//有逗号时
				selGuaId=selGuaId.replace(","+t.id, "");//连逗号一起替换
			}
			
			//t.style.backgroundColor = '';
			//$("#"+t.id).removeAttr("class").attr("class","coll_img");
			//判断大人头像背景
			var bgColor="";
			if((inTime!=null && inTime!="") && (outTime==null || outTime=="")){//绿色-场内
				bgColor="coll_img colle_img_lv";
			}else{//灰色-场外
				bgColor="coll_img colle_img_ccc";
			}
			$("#"+t.id).attr("class",bgColor);
		} else {
			//t.style.backgroundColor = '#6eafdd';
			$("#"+t.id).attr("class","coll_img colle_img_blue");
			
			if(selGuaId==""){
				selGuaId += t.id;
			}else{
				selGuaId += ","+t.id;
			}
		}
		$("#inGuaIds").val(selGuaId);
}

</script>

<script type="text/javascript">
function goIn(){
	var inMemberIds=$("#inMemberIds").val();
	var inMemTypes=$("#inMemTypes").val();
	var inStatuss=$("#inStatuss").val();
	var inGuaIds=$("#inGuaIds").val();
	var signDisclaimers=$("#signDisclaimers").val();
	var ages=$("#ages").val();
	var inGuaCnts=$("#inGuaCnts").val();
	var inGuaTicketCounts=$("#inGuaTicketCounts").val();
	var receivePwds=$("#receivePwds").val();
	var inMemberIdArray=inMemberIds.split(",");
	var inMemTypeArray=inMemTypes.split(",");
	var inStatusArray=inStatuss.split(",");
	var inGuaIdArray=inGuaIds.split(",");
	var signDisclaimerArray=signDisclaimers.split(",");//免责声明标记
	var ageArray=ages.split(",");
	var receivePwdArray=receivePwds.split(",");
	var inGuaCntArray=inGuaCnts.split(",");
	var inGuaTicketCountArray=inGuaTicketCounts.split(",");

	//未选择任何客人
	if((inMemberIds=="" || inMemberIds==null) && (inGuaIds=="" || inGuaIds==null)){
		alertError("请选择进场的儿童或监护人!");
		return;
	}
	
	//选择单成人且场内无儿童
	var hasLocIn=false;
	<c:forEach items="${memList }" var="member" varStatus="status">
		if(("${member.inTime}"!=null && "${member.inTime}"!="") && ("${member.outTime}"==null || "${member.outTime}"=="")){
			hasLocIn=true;
		}
	</c:forEach>
	
	if((inMemberIds=="" || inMemberIds==null) && (inGuaIds!="" && inGuaIds!=null)){//只有成人进入时
		//如果场内无他家的儿童，提示不给进
		//此处写通过监护人查询小孩的方法
		
		if(hasLocIn==false){//场内无儿童时
			alertError("单成人进入时场内必须有儿童!");
			return;
		}
	}
	
	//选择单儿童且免责声明未签署
	if((inMemberIds!="" && inMemberIds!=null && inMemberIdArray.length!=null && inMemberIdArray.length==1) && (inGuaIds=="" || inGuaIds==null)){//单儿童进入时
		if(signDisclaimerArray!=null && signDisclaimerArray[0]!="1"){//且免责声明未签署
			alertError("单儿童进场必须签署读完免责声明!");
			return;
		}
	}
	
	//选择单儿童且儿童年龄在5岁以下
	if((inMemberIds!="" && inMemberIds!=null && inMemberIdArray!=null && inMemberIdArray.length==1) && (inGuaIds=="" || inGuaIds==null)){//单儿童进入时
		if(ageArray!=null && ageArray[0]<5){//且儿童年龄在5岁以下
			alertError("单儿童进场时年龄起码要5岁!");
			return;
		}
	}
	
	//多个儿童进入时
	if((inMemberIds!="" && inMemberIds!=null && inMemberIdArray!=null && inMemberIdArray.length>1) && (inGuaIds=="" || inGuaIds==null)){
		//如果存在年龄小于5的，提示必须有大人
		for (var i = 0; i < ageArray.length; i++) {
			var age = ageArray[i];
			if(age==null || age==""){
				age=0;
			}
			if(age<5){
				alertError("多个儿童进场时年龄起码要5岁，请让大人陪同!");
				return;
			}
		}
	}
	
	//选择成人数量超过(会员类型允许的成人数量以及会员关联的未使用成人票之和)
	if(null!=inGuaCntArray && inGuaCntArray.length>0){
		var isGuaCnt=false;
		for (var i = 0; i < inGuaCntArray.length; i++) {
			var inMemType=inMemTypeArray[i];
			var status=inStatusArray[i];
			var inGuaCnt=0;
			if(null!=inMemType && inMemType=="1" && status!="4"){
				//会籍
				inGuaCnt=inGuaCntArray[i];
			}else{
				//单次票
				inGuaCnt=1;
			}
			var inGuaTicketCount=inGuaTicketCountArray[i];
			//alert(inGuaCnt);alert(inGuaTicketCount);
			if(inGuaCnt==null || inGuaCnt==""){
				inGuaCnt="0";
			}
			if(inGuaTicketCount==null || inGuaTicketCount==""){
				inGuaTicketCount="0";
			}
			//alert(null!=inGuaIds && ""!=inGuaIds && inGuaIdArray.length>inGuaCnt);
			//alert(parseInt(inGuaCnt)+parseInt(inGuaTicketCount));
			
			if(null!=inMemType && (inMemType=="1" || inMemType=='2') && null!=inGuaIds && ""!=inGuaIds && inGuaIdArray.length>(parseInt(inGuaCnt)+parseInt(inGuaTicketCount))){
				isGuaCnt=true;
				break;
			}
		}
		if(isGuaCnt==true){
			alertError("选择成人数量不能超过会员类型允许的成人数量以及会员购买的未使用成人票之和!");
			return;
		}
	}
	
	if((inGuaIds!="" && inGuaIds!=null) && inGuaIdArray.length>4){
		alertError("一个小孩最多可带4个大人进场!");
		return;
	}
	
	//判断接领密码
	var receivePwd=$("#receivePwd").val();
	var receivePwd2=$("#receivePwd2").val();
	
	//进场时，如果没有大人，只有符合条件的一个或多个儿童时，并且密码为空时，需要重新设定接领密码
	if((inMemberIds!="" && inMemberIds!=null) && (inGuaIds=="" || inGuaIds==null)){//单儿童进入时
		if(null!=receivePwdArray && receivePwdArray.length>0){
			var receivePwdNull=null;
			for (var i = 0; i < receivePwdArray.length; i++) {
				var receivePwd3=receivePwdArray[i];
				if(receivePwd3==null || receivePwd3==""){
					receivePwdNull="yes";
					break;
				}
			}
			if((null!=receivePwdNull && receivePwdNull=="yes") && (receivePwd==null || receivePwd=="")){
				alertError("存在未设置接领密码的儿童，请设置后进场!");
				return;
			}
		}
	}
	
	if(receivePwd2!=receivePwd){
		alertError("接领密码必须相同！");
		return;
	}
	
	//赋值给form表单接领密码
	if(receivePwd==null || receivePwd==""){
		$("#receivePwds").val(null);
	}else{
		$("#receivePwds").val(receivePwd);
	}
	
	//进场操作
	$.messager.confirm('提示','是否确定要进场？',function(r) {
		if (r) {
			$.ajax({
				cache : false,
				type : "post",
				url : "locPerGoIn.shtml",
				data :$("#inForm").serialize(),
				success : function(batPath) {
					if (batPath!="") {
	    				//alertError("操作成功");
	    				//入场
						var wsh=null;
  						try {
	  						wsh = new ActiveXObject("WScript.Shell"); //允许bat文件  
						} catch (e) {
							alert(e.message);
						}
						try {
							wsh.run(batPath);
						} catch (e) {
							//alert(e.message);
						}
 						
 						//window.location="C:/Windows/system/Door/opendoor.bat";
 						//window.location.href="${basePath}management/site/openDoor.shtml?batPath="+batPath;
	    				window.location.href="${basePath}management/site/locPerManager.shtml?type=1";
					}
				},
				error : function(XMLHttpRequest) {
					ajaxError(XMLHttpRequest);
				}
			});
		}
	});
}

function goOut(){
	var inMemberIds=$("#inMemberIds").val();
	var inGuaIds=$("#inGuaIds").val();
	var receivePwds=$("#receivePwds").val();
	var receivePwdArray=receivePwds.split(",");
	var inGuaIdArray=inGuaIds.split(",");
	var inMemberIdArray=inMemberIds.split(",");
	
	//选择单成人且场内无儿童
	var hasLocIn=false;//判断场内是否有小孩
	var signDisclaimer=true;//判断是否签署独玩免责
	var isAge=true;//判断年龄是否大于5岁
	var hasGuaLocIn=false;//判断场内是否有监护人
	var hasReceivePwd=true;//判断场内儿童是否有接领密码
	var memSize=0;
	<c:forEach items="${memList }" var="member" varStatus="status">
		if(("${member.inTime}"!=null && "${member.inTime}"!="") && ("${member.outTime}"==null || "${member.outTime}"=="")){
			hasLocIn=true;
			if("${member.signDisclaimer}"=="0"){
				signDisclaimer=false;
			}
			if("${member.age}"<5){
				isAge=false;
			}
			if("${member.receivePwd}"==""){
				hasReceivePwd=false;
			}
			memSize+=1;
		}
	</c:forEach>
	var guaSize=0;
	<c:forEach items="${guaList }" var="gua" varStatus="status">
		if(("${gua.inTime}"!=null && "${gua.inTime}"!="") && ("${gua.outTime}"==null || "${gua.outTime}"=="")){
			hasGuaLocIn=true;
			guaSize+=1;
		}
</c:forEach>

	//未选择任何客人
	if((inMemberIds=="" || inMemberIds==null) && (inGuaIds=="" || inGuaIds==null)){
		alertError("请选择出场的儿童或监护人!");
		return;
	}
	
	//选择成人出场，场内只留下儿童且单独游玩免责声明未签署
	if((inMemberIds=="" || inMemberIds==null) && (inGuaIds!="" && inGuaIds!=null)){//只有成人出来时
		if(hasLocIn==true && signDisclaimer==false){//场内有儿童且单独游玩免责声明未签署时
			alertError("选择成人出场时，场内不能留下免责声明未签署的儿童!");//少条件：场内无大人时
			return;
		}
		
		//选择成人出场，场内只留下儿童且儿童年龄<5岁
		if(hasLocIn==true && isAge==false){
			alertError("选择成人出场时，场内不能留下小于5岁的儿童!");
			return;
		}
		
		//选择成人出场，场内只留下儿童且没有接领密码
		if(hasLocIn==true && hasReceivePwd==false){
			alertError("选择成人出场时，场内不能留下没有接领密码的儿童!");
			return;
		}
	}
	
	//选择儿童出场，无成人陪同
	/* if((inMemberIds!="" && inMemberIds!=null) && (inGuaIds=="" || inGuaIds==null)){
		alertError("选择儿童出场时必须有大人陪同!");
		return;
	} */
	
	
	//选择单独在场内游玩的儿童，且接领人为不允许接领的成员，或者未提供接领密码，或者提供的接领密码不正确
	//判断接领密码
	
	//if(!((inMemberIds=="" || inMemberIds==null) && (inGuaIds!="" && inGuaIds!=null))){//不只是成人出来时
	if((inMemberIds!="" && inMemberIds!=null) && (inGuaIds=="" || inGuaIds==null)){//只有小孩，没有大人时，需判断接领密码
		//判断选择的小孩中是否有接领密码不一样的
		if(hasGuaLocIn==true){
			//场内有大人小孩单独出场，需提示必须和大人一起出
			alertError("单儿童出场时，场内不能留下大人!");
			return;
		}
		if(null!=receivePwdArray && receivePwdArray.length>0){
			var receivePwdNotEq=null;
			var nary=receivePwdArray.sort();
			for (var i = 0; i < receivePwdArray.length-1; i++) {
				try {
					if(nary[i]!=nary[i+1]){
						receivePwdNotEq="yes";
						break;
					}else{
						//全部一样时
						
					}
				} catch (e) {
					//全部一样时
					
				}
			}
			if(null!=receivePwdNotEq && receivePwdNotEq=="yes"){
				alertError("存在接领密码不一样的儿童，请分批出场!");
				return;
			}else{
				receivePwds=receivePwdArray[0];
			}
		}
		
		if ($("#receivePwd").val() == "") {
			alertError("接领密码不能为空！");
			return false;
		}
		if ($("#receivePwd").val() != receivePwds) {
			alertError("接领密码有误！");
			return false;
		}
	}else if((inMemberIds!="" && inMemberIds!=null) && (inGuaIds!="" && inGuaIds!=null) && (inGuaIdArray.length!=guaSize)){
		//有大人有小孩时，还留下大人的情况
		alertError("场内不能留下大人!");
		return;
	}else if((inMemberIds!="" && inMemberIds!=null) && (inGuaIds!="" && inGuaIds!=null) && (inMemberIdArray.length!=memSize)){
		var signDisclaimer2=true;//判断是否签署独玩免责
		var isAge2=true;//判断年龄是否大于5岁
		var hasReceivePwd2=true;//判断场内儿童是否有接领密码
		//有大人有小孩时，还留下大人的情况
		<c:forEach items="${memList }" var="member" varStatus="status">
		if(("${member.inTime}"!=null && "${member.inTime}"!="") && ("${member.outTime}"==null || "${member.outTime}"=="")){
			var memId="${member.pkMemId}";
			if(inMemberIds.indexOf(memId)==-1){
				//选择的出场儿童中没有这个小孩，则开始判断
				if("${member.signDisclaimer}"=="0"){
					signDisclaimer2=false;
				}
				if("${member.age}"<5){
					isAge2=false;
				}
				if("${member.receivePwd}"==""){
					hasReceivePwd2=false;
				}
			}
		}
		</c:forEach>
		if(signDisclaimer2==false){
			alertError("场内不能留下免责声明未签署的儿童!");
			return;
		}
		
		if(isAge2==false){
			alertError("场内不能留下小于5岁的儿童!");
			return;
		}
		
		if(hasReceivePwd2==false){
			alertError("场内不能留下没有接领密码的儿童!");
			return;
		}
	}
	
	//出场操作
	$.messager.confirm('提示','是否确定要出场？',function(r) {
		if (r) {
			$.ajax({
				cache : false,
				type : "post",
				url : "locPerGoOut.shtml",
				data :$("#inForm").serialize(),
				success : function(batPath) {
					if (batPath!="") {
	    				//alertInfo("操作成功");
	    				//出场
    					var wsh=null;
  						try {
	  						wsh = new ActiveXObject("WScript.Shell"); //允许bat文件  
						} catch (e) {
							alert(e.message);
						}
						try {
							wsh.run(batPath);
						} catch (e) {
							//alert(e.message);
						}
	    				window.location.href="${basePath}management/site/locPerManager.shtml?type=2";
					}
				},
				error : function(XMLHttpRequest) {
					ajaxError(XMLHttpRequest);
				}
			});
		}
	});
	
}

function  collectFingerprint() {
	try {
		var data = collectFingerFeatrue();
		if (data != "") {
			queryMemberByFingerprint(data);
		}
	} catch (e) {
		return "";
	}
}

//根据指纹查询
function queryMemberByFingerprint(fingerprint) {
	if (fingerprint == "") {
		alertError(getMessage($common_msg_empty, "指纹采集失败，请重新录入指纹"));
		return false;
	}
	$("#fingerprint").val(fingerprint);
	$.ajax({
		cache : false,
		type : "post",
		dataType : "json",
		url : "${basePath}management/site/queryMemberByFingerprint.shtml",
		data :$("#fpForm").serialize(),
		complete : function() {
		},
		success : function(data) {//data为返回的数据，在这里做数据绑定
			if (data == null) {
				alertInfo("没有匹配的记录！");
			} else {
				trimJsonArray(data);
				var receivePwd=data.receivePwd;
				$("#receivePwd").val(receivePwd);
				$("#receivePwd2").val(receivePwd);
			}
			return;
		}
	});
}
</script>

</head>

<body class="bg">

<div class="content m_auto ">
	<div class="content_l mt10">
    	<ul>
        	<shiro:hasPermission name="management/site/locPerManager.shtml?type=1">
				<li <c:if test="${type==1 }">class="content_hover"</c:if>><a href="${basePath}management/site/locPerManager.shtml?type=1"><i class="nav_icon_c"></i><br>入场管理</a></li>
			</shiro:hasPermission>
        	<shiro:hasPermission name="management/site/locPerManager.shtml?type=2">
            	<li <c:if test="${type==2 }">class="content_hover"</c:if>><a href="${basePath}management/site/locPerManager.shtml?type=2"><i class="nav_icon_i"></i><br>出场管理</a></li>
            </shiro:hasPermission>
            <shiro:hasPermission name="management/site/locPerMemer.shtml">
            	<li><a href="${basePath}management/site/locPerMemer.shtml"><i class="nav_icon_j"></i><br>场内人员</a></li>
            </shiro:hasPermission>
        </ul>
    </div>
    <div class="content_r mt10" >
        <div id="containerTop"  class="collection_t ml10 fixed">
           	<div id="btnNextTop"><a class="collection_t_l" href="javascript:void(0);"></a></div>
           	<div id="listBoxTop" >
           	<ul id="listTop" >
           		<!-- 会员信息 start -->
								<c:forEach items="${memList }" var="member" varStatus="status">
								<%-- <c:if test="${type==2 && (member.inTime != null && member.inTime != '') && (member.outTime == null || member.outTime == '')}"> --%>
								<c:if test="${member.status!=5}">
									<c:if test="${type==1}">
									<li id="li_member_${member.pkMemId}">
										<div class="collection_contet mt20" >
											<div class="collection_img fl">
												<span class="collection_span">
													<span class="ing_hover">
														<i>${member.imageTimePage}</i>
														<img onclick="setMemberCss(this,'${member.status}','${member.signDisclaimer}','${member.age}','${member.inTime}','${member.outTime}','${member.receivePwd}','${member.isBlack}','${member.guaCnt}','${member.guaTicketCount}','${member.memType}',${member.isSingleTicket})" id="${member.pkMemId}" class="
														<c:if test="${member.isBlack == 1 || member.status == 3 || member.status == 4 || member.status == null || member.status == ''}">
															<c:if test="${(member.inTime != null && member.inTime != '') && (member.outTime == null || member.outTime == '')}">
																coll_img colle_img_lv
															</c:if>
															<c:if test="${(member.inTime == null || member.inTime == '') || (member.outTime != null && member.outTime != '')}">
																<c:if test="${member.status == 4 && member.isSingleTicket==true}">
																	coll_img colle_img_ccc
																</c:if>
																<c:if test="${member.status != 4 || member.isSingleTicket!=true}">
																	coll_img colle_img_red
																</c:if>
															</c:if>
														</c:if>
														<c:if test="${member.isBlack != 1 && member.status != 3 && member.status != 4 && member.status != null && member.status != ''}">
															<c:if test="${(member.inTime != null && member.inTime != '') && (member.outTime == null || member.outTime == '')}">
																coll_img colle_img_lv
															</c:if>
															<c:if test="${(member.inTime == null || member.inTime == '') || (member.outTime != null && member.outTime != '')}">
																coll_img colle_img_ccc
															</c:if>
														</c:if>
														" style="width:145px; height:190px;" src="${basePath}common/showImage.shtml?imagePath=${member.imagePath}">
													</span>
												</span>
											</div>
											<div class="collection_text w160 fl">
												<div class="fl">
													<h2>
														<i class="f18" title="${member.memName}">
														<c:choose> 
															<c:when test="${fn:length(member.memName) > 5}">${fn:substring(member.memName, 0, 5)}...</c:when> 
															<c:otherwise>${member.memName}</c:otherwise>
														</c:choose>
														</i>
														<em class="ml10">${member.sex}</em>
														<c:if test="${member.isVip == 1}">
															<i class="vip_icon ml10"></i>
														</c:if>
													</h2>
													<dl class="f14 mt20">
														<dd>生日：${member.birthdayPage}</dd>
														<dd>国籍：${member.countryDesc}</dd>
														<dd>
															<c:if test="${member.memType == 1}">会员</c:if>
															<c:if test="${member.memType == 2}">非会员</c:if>
															<c:if test="${member.memType == 3}">访客</c:if>
															：<span class="f11">${member.pkMemId}</span>
														</dd>

														<%-- <dd>推荐会员：${member.memName}</dd> --%>
														<!-- <i class="heto_icon"></i> -->
														<dd>${member.memberCardName}</dd>
														<dd>
															<c:if test="${member.status == 2}">
																<i class="youx_icon mr10"></i>
															</c:if>
															<c:if test="${member.signDisclaimer == 1}">
																<i class="duwa_icon ml10"></i>
															</c:if>
														</dd>
													</dl>
												</div>

											</div>
											<div class="zhuyi" style="width: 120px !important;">
												<h1>注意事项</h1>
												<p title="${member.note}">
													<c:choose> 
														<c:when test="${fn:length(member.note) == 0}">无</c:when> 
														<c:when test="${fn:length(member.note) > 38}">${fn:substring(member.note, 0, 38)}...</c:when> 
														<c:otherwise>${member.note}</c:otherwise>
													</c:choose>
												</p>
												<h1 class="zhuyi_bo">员工备注</h1>
												<p title="${member.memo}">
													<c:choose> 
														<c:when test="${fn:length(member.memo) == 0}">无</c:when> 
														<c:when test="${fn:length(member.memo) > 38}">${fn:substring(member.memo, 0, 38)}...</c:when> 
														<c:otherwise>${member.memo}</c:otherwise>
													</c:choose>
												</p>
											</div>
										</div>
									</li>
									</c:if>
									
									<c:if test="${type==2}">
									<!-- 只显示场内人员 -->
									<c:if test="${(member.inTime != null && member.inTime != '') && (member.outTime == null || member.outTime == '')}">
									<li id="li_member_${member.pkMemId}">
										<div class="collection_contet mt20" >
											<div class="collection_img fl">
												<span class="collection_span">
													<span class="ing_hover">
														<i>${member.imageTimePage}</i>
														<img onclick="setMemberCss(this,'${member.status}','${member.signDisclaimer}','${member.age}','${member.inTime}','${member.outTime}','${member.receivePwd}','${member.isBlack}','${member.guaCnt}','${member.guaTicketCount}','${member.memType}',${member.isSingleTicket})" id="${member.pkMemId}" class="
														<c:if test="${member.isBlack == 1 || member.status == 3 || member.status == 4 || member.status == null || member.status == ''}">
															<c:if test="${(member.inTime != null && member.inTime != '') && (member.outTime == null || member.outTime == '')}">
																coll_img colle_img_lv
															</c:if>
															<c:if test="${(member.inTime == null || member.inTime == '') || (member.outTime != null && member.outTime != '')}">
																<c:if test="${member.status == 4 && member.isSingleTicket==true}">
																	coll_img colle_img_ccc
																</c:if>
																<c:if test="${member.status != 4 || member.isSingleTicket!=true}">
																	coll_img colle_img_red
																</c:if>
															</c:if>
														</c:if>
														<c:if test="${member.isBlack != 1 && member.status != 3 && member.status != 4 && member.status != null && member.status != ''}">
															<c:if test="${(member.inTime != null && member.inTime != '') && (member.outTime == null || member.outTime == '')}">
																coll_img colle_img_lv
															</c:if>
															<c:if test="${(member.inTime == null || member.inTime == '') || (member.outTime != null && member.outTime != '')}">
																coll_img colle_img_ccc
															</c:if>
														</c:if>
														" style="width:145px; height:190px;" src="${basePath}common/showImage.shtml?imagePath=${member.imagePath}">
													</span>
												</span>
											</div>
											<div class="collection_text w160 fl">
												<div class="fl">
													<h2>
														<i class="f18" title="${member.memName}">
														<c:choose> 
															<c:when test="${fn:length(member.memName) > 5}">${fn:substring(member.memName, 0, 5)}...</c:when> 
															<c:otherwise>${member.memName}</c:otherwise>
														</c:choose>
														</i>
														<em class="ml10">${member.sex}</em>
														<c:if test="${member.isVip == 1}">
															<i class="vip_icon ml10"></i>
														</c:if>
													</h2>
													<dl class="f14 mt20">
														<dd>生日：${member.birthdayPage}</dd>
														<dd>国籍：${member.countryDesc}</dd>
														<dd>
															<c:if test="${member.memType == 1}">会员</c:if>
															<c:if test="${member.memType == 2}">非会员</c:if>
															<c:if test="${member.memType == 3}">访客</c:if>
															：<span class="f11">${member.pkMemId}</span>
														</dd>

														<!-- <i class="heto_icon"></i> -->
														<dd>${member.memberCardName}</dd>
														<dd>
															<c:if test="${member.status == 2}">
																<i class="youx_icon mr10"></i>
															</c:if>
															<c:if test="${member.signDisclaimer == 1}">
																<i class="duwa_icon ml10"></i>
															</c:if>
														</dd>
													</dl>
												</div>

											</div>
											<div class="ml10 fl">
												<h1>注意事项</h1>
												<textarea class=" textare w100">${member.note}</textarea>
												<h1 class="mt20">员工备注</h1>
												<textarea class="textare w100">${member.memo}</textarea>
											</div>
										</div>
									</li>
									</c:if>
									</c:if>
								</c:if>
								</c:forEach>
								<!-- 会员信息 end -->
            </ul>
            
        </div><div id="btnPrevTop"> <a href="javascript:void(0);" class="collection_t_r"></a></div></div>
        <div class="clear"></div>
        <div  class="collection_b border_top w630 ml10 fl border_r">
        	<div id="container">
			<div id="btnNext"><a href="javascript:void(0);" class="collection_t_l"></a></div>
            	<div id="listBox">
            	<ul id="list">
                    <c:forEach items="${guaList }" var="gua">
                    			<c:if test="${type==1}">
									<li id="li_gua_${gua.pkGuaId}">
										<h1>${gua.relDesc }</h1>
										<p class="
										<c:if test="${(gua.inTime != null && gua.inTime != '') && (gua.outTime == null || gua.outTime == '')}">
											coll_img colle_img_lv
										</c:if>
										<c:if test="${(gua.inTime == null || gua.inTime == '') || (gua.outTime != null && gua.outTime != '')}">
											coll_img colle_img_ccc
										</c:if>
										" id="${gua.pkGuaId }" onclick="setGuaCss(this,'${gua.inTime}','${gua.outTime}')">
											<i>${gua.imageTimePage }</i> 
											<img src="${basePath}common/showImage.shtml?imagePath=${gua.imagePath}" width="102" height="136">
										</p>
										<dl class="collection_t_l_dl">
											<dd title="${gua.name }">
														<c:choose> 
															<c:when test="${fn:length(gua.name) > 8}">${fn:substring(gua.name, 0, 8)}...</c:when> 
															<c:otherwise>${gua.name}</c:otherwise>
														</c:choose>
											</dd>
											<dd>${gua.telNum }</dd>
											<dd>
												<c:if test="${gua.canReceive == 1 }">
													<i class="jiel_icon"></i>
												</c:if>
												<c:if test="${gua.canConsume == 1 }">
													<i class="qians_icon ml10" title="可消费余额"></i>
												</c:if>
											</dd>
										</dl>
									</li>
								</c:if>
								
								<c:if test="${type==2}">
								<!-- 只显示场内人员 -->
								<c:if test="${(gua.inTime != null && gua.inTime != '') && (gua.outTime == null || gua.outTime == '')}">
									<li id="li_gua_${gua.pkGuaId}">
										<h1>${gua.relDesc }</h1>
										<p class="
										<c:if test="${(gua.inTime != null && gua.inTime != '') && (gua.outTime == null || gua.outTime == '')}">
											coll_img colle_img_lv
										</c:if>
										<c:if test="${(gua.inTime == null || gua.inTime == '') || (gua.outTime != null && gua.outTime != '')}">
											coll_img colle_img_ccc
										</c:if>
										" id="${gua.pkGuaId }" onclick="setGuaCss(this,'${gua.inTime}','${gua.outTime}')">
											<i>${gua.imageTimePage }</i> 
											<img src="${basePath}common/showImage.shtml?imagePath=${gua.imagePath}" width="102" height="136">
										</p>
										<dl class="collection_t_l_dl">
											<dd>${gua.name }</dd>
											<dd>${gua.telNum }</dd>
											<dd>
												<c:if test="${gua.canReceive == 1 }">
													<i class="jiel_icon"></i>
												</c:if>
												<c:if test="${gua.canConsume == 1 }">
													<i class="qians_icon ml10" title="可消费余额"></i>
												</c:if>
											</dd>
										</dl>
									</li>
								</c:if>
								</c:if>
							</c:forEach>
                </ul>
                </div>
               <div id="btnPrev"><a href="javascript:void(0);" class="collection_t_r"></a></div>
               </div>
		</div>
		<div class="payment_r mt30">
        	<div style="display:none;">
			<object classid="clsid:82C2415C-1EC7-41ED-A6F0-2BCA3B4216E2" id="finger" codebase="${basePath }plugin/Ferly727.ocx">
			  <param name="_ExtentX" value="635">
			  <param name="_ExtentY" value="582">
			  <param name="_StockProps" value="64">
			  <param name="Enabled" value="1">
			</object>
		</div>
        <div class="manage_sticket border_top tc">
        <form id="fpForm" method="post">
        	<a href="#" onClick="collectFingerprint();"><img class="mt20" src="${basePath }commonCss/images/zhiwen_c.png"><input type="hidden" name="fingerprint" id="fingerprint"></a>
        </form>
            	<p class="mt20"><label>接领密码：</label><input type="password" class="iput_t" id="receivePwd"></p>
            	<c:if test="${type==1 }">
            		<p class="mt20"><label>重复密码：</label><input type="password" class="iput_t" id="receivePwd2"></p>
            	</c:if>
        </div>
        <div class="clear"></div>
        <div class="btm_btn mt20">
            <dl>
            </br>
            </br>
            	<dd><a href="${basePath}management/site/locPerManager.shtml?type=${type}"><input type="button" class="btn" value="取&nbsp;&nbsp;消"></a></dd>
                <c:if test="${type==1 }">
                	<dd><a href="javascript:"><input type="button" class="btn" value="进&nbsp;&nbsp;场" onclick="goIn();"></a></dd>
    			</c:if>
        		<c:if test="${type==2 }">
                	<dd><a href="javascript:"><input type="button" class="btn" value="出&nbsp;&nbsp;场" onclick="goOut();"></a></dd>
    			</c:if>
            </dl>
        </div>
    </div>
    <form id="inForm">
    	<input type="hidden" id="inMemberIds" name="inMemberIds" />
    	<input type="hidden" id="inMemTypes" name="inMemTypes" />
    	<input type="hidden" id="inStatuss" name="inStatuss" />
    	<input type="hidden" id="inGuaIds" name="inGuaIds" />
    	<input type="hidden" id="signDisclaimers" name="signDisclaimers" />
    	<input type="hidden" id="ages" name="ages" />
    	<input type="hidden" id="type" name="type" value="${type }" />
    	<input type="hidden" id="receivePwds" name="receivePwds" />
    	<input type="hidden" id="familyId" name="familyId" value="${memberInfo.familyId }" />
    	<input type="hidden" id="inGuaCnts" name="inGuaCnts" />
    	<input type="hidden" id="inGuaTicketCounts" name="inGuaTicketCounts" />
    </form>
</div>
</body>
</html>
